{extend  name="manage@public/layout" /}
{block name="content"}
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5 style="margin:-5px 5px 0px !important;">
                            <button onClick="modaldemo(0)" style="padding:4px;margin-bottom:0 !important" type="button" class="btn btn-primary btn-xs">添加账号</button>
                        </h5>
                        <div class="ibox-tools">
                            <a class="collapse-link" onclick="location.replace(location.href);">
                                <i class="fa fa-refresh"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>登录账号</th>
                                        <th>角色</th>
                                        <th>昵称</th>
                                        <th>状态</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                   {volist name="list" id="vo"}
                                    <tr>
                                        <td>{$vo.id}</td>
                                        <td>{$vo.user_name}</td>
                                        <td>{:\\app\\model\\Role::roleType($vo.role_id)}</td>
                                        <td>{$vo.nickname}</td>
                                        <td>
                                            <input data-type="rj" data-url="{:url('/manage/account_status')}" {eq name="vo.role_id" value="1"} disabled {/eq} {eq  name="vo.type" value="1"}checked{/eq} data-id="{$vo.id}" type="checkbox" class="js-switch"  />
                                        </td>
                                        <td>
                                            {eq name="vo.role_id" value="1"} 
                                            <span class="btn btn-sm btn-white"><i class="fa fa-ban"></i>&nbsp;无可操作</span>
                                            {else/}
                                            <button onClick="modaldemo({$vo.id})" type="button" class="btn btn-sm btn-white"><i class="fa fa-edit"></i>&nbsp;编辑</button>
                                            <button type="button" data-id="{$vo.id}" class="btn btn-sm bt-acc-del btn-white"><i class="fa fa-trash"></i>&nbsp;删除</button>
                                            {/eq}
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                            <div style="float:right;" class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                                <ul class="pagination">
                                    
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div> 
    <!-- 弹框 --->
    <div id="modal-demo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
        <div class="modal-dialog">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">添加账号</h3>
                    <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
                </div>
                <input type="hidden" name="role_id" value="0" />
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">登录账号</label>
                        <div class="col-sm-7">
                            <input type="text" onkeyup="value=value.replace(/[\u4e00-\u9fa5]/ig,'')" placeholder="请输入登录账号" name="user_name" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">登录密码</label>
                        <div class="col-sm-7">
                            <input type="password" placeholder="请输入登录密码" name="password" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">角色</label>
                        <div class="col-sm-7" id="select">
                            
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">昵称</label>
                        <div class="col-sm-7" id="select">
                            <input type="text" placeholder="请输入昵称" name="nickname" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary btn-account ">确定</button>
                    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
                </div>
            </div>
        </div>
    </div>
    <!--  end --->
{/block}
 {block name="script"}
<script src="/static/js/admin/system.js"></script>
{/block}

